package com.clt.web.common;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * 微信菜单3X3配置文件读取类
 * 
 * @author wenjian
 * 
 */
public class WeiXinMenuPropertiesUtil {

	private static Properties properties = new Properties();
	// 左菜单
	private static String l_main_menu_name;
	private static String l_main_menu_type;
	private static String l_main_menu_url;
	// 左菜单子菜单1
	private static String l_main_menu_name_1;
	private static String l_main_menu_type_1;
	private static String l_main_menu_url_1;
	// 左菜单子菜单2
	private static String l_main_menu_name_2;
	private static String l_main_menu_type_2;
	private static String l_main_menu_url_2;
	// 左菜单子菜单3
	private static String l_main_menu_name_3;
	private static String l_main_menu_type_3;
	private static String l_main_menu_url_3;
	// 中间菜单
	private static String m_main_menu_name;
	private static String m_main_menu_type;
	private static String m_main_menu_url;
	// 中间菜单子菜单1
	private static String m_main_menu_name_1;
	private static String m_main_menu_type_1;
	private static String m_main_menu_url_1;
	// 中间菜单子菜单2
	private static String m_main_menu_name_2;
	private static String m_main_menu_type_2;
	private static String m_main_menu_url_2;
	// 中间菜单子菜单3
	private static String m_main_menu_name_3;
	private static String m_main_menu_type_3;
	private static String m_main_menu_url_3;
	// 右菜单
	private static String r_main_menu_name;
	private static String r_main_menu_type;
	private static String r_main_menu_url;
	// 右菜单子菜单1
	private static String r_main_menu_name_1;
	private static String r_main_menu_type_1;
	private static String r_main_menu_url_1;
	// 右菜单子菜单2
	private static String r_main_menu_name_2;
	private static String r_main_menu_type_2;
	private static String r_main_menu_url_2;
	// 右菜单子菜单3
	private static String r_main_menu_name_3;
	private static String r_main_menu_type_3;
	private static String r_main_menu_url_3;
	private static String menuPath = Thread.currentThread().getContextClassLoader().getResource("weixin-menu.properties")
			.getPath().replace("%20", " ");
	static {
		FileInputStream in = null;
		try {
			in = new FileInputStream(menuPath);
			properties.load(in);
			// 左菜单
			l_main_menu_name = properties.getProperty("l_main_menu_name");
			l_main_menu_type = properties.getProperty("l_main_menu_type");
			l_main_menu_url = properties.getProperty("l_main_menu_url");
			// 左菜单子菜单
			l_main_menu_name_1 = properties.getProperty("l_main_menu_name_1");
			l_main_menu_type_1 = properties.getProperty("l_main_menu_type_1");
			l_main_menu_url_1 = properties.getProperty("l_main_menu_url_1");
			l_main_menu_name_2 = properties.getProperty("l_main_menu_name_2");
			l_main_menu_type_2 = properties.getProperty("l_main_menu_type_2");
			l_main_menu_url_2 = properties.getProperty("l_main_menu_url_2");
			l_main_menu_name_3 = properties.getProperty("l_main_menu_name_3");
			l_main_menu_type_3 = properties.getProperty("l_main_menu_type_3");
			l_main_menu_url_3 = properties.getProperty("l_main_menu_url_3");
			// 中间菜单
			m_main_menu_name = properties.getProperty("m_main_menu_name");
			m_main_menu_type = properties.getProperty("m_main_menu_type");
			m_main_menu_url = properties.getProperty("m_main_menu_url");
			// 中间菜单子菜单
			m_main_menu_name_1 = properties.getProperty("m_main_menu_name_1");
			m_main_menu_type_1 = properties.getProperty("m_main_menu_type_1");
			m_main_menu_url_1 = properties.getProperty("m_main_menu_url_1");
			m_main_menu_name_2 = properties.getProperty("m_main_menu_name_2");
			m_main_menu_type_2 = properties.getProperty("m_main_menu_type_2");
			m_main_menu_url_2 = properties.getProperty("m_main_menu_url_2");
			m_main_menu_name_3 = properties.getProperty("m_main_menu_name_3");
			m_main_menu_type_3 = properties.getProperty("m_main_menu_type_3");
			m_main_menu_url_3 = properties.getProperty("m_main_menu_url_3");
			// 右菜单
			r_main_menu_name = properties.getProperty("r_main_menu_name");
			r_main_menu_type = properties.getProperty("r_main_menu_type");
			r_main_menu_url = properties.getProperty("r_main_menu_url");
			// 右菜单子菜单
			r_main_menu_name_1 = properties.getProperty("r_main_menu_name_1");
			r_main_menu_type_1 = properties.getProperty("r_main_menu_type_1");
			r_main_menu_url_1 = properties.getProperty("r_main_menu_url_1");
			r_main_menu_name_2 = properties.getProperty("r_main_menu_name_2");
			r_main_menu_type_2 = properties.getProperty("r_main_menu_type_2");
			r_main_menu_url_2 = properties.getProperty("r_main_menu_url_2");
			r_main_menu_name_3 = properties.getProperty("r_main_menu_name_3");
			r_main_menu_type_3 = properties.getProperty("r_main_menu_type_3");
			r_main_menu_url_3 = properties.getProperty("r_main_menu_url_3");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

	public static Properties getProperties() {
		return properties;
	}

	public static void setProperties(Properties properties) {
		WeiXinMenuPropertiesUtil.properties = properties;
	}

	public static String getL_main_menu_name() {
		return l_main_menu_name;
	}

	public static void setL_main_menu_name(String l_main_menu_name) {
		WeiXinMenuPropertiesUtil.l_main_menu_name = l_main_menu_name;
	}

	public static String getL_main_menu_type() {
		return l_main_menu_type.length()==0?"view":l_main_menu_type;
	}

	public static void setL_main_menu_type(String l_main_menu_type) {
		WeiXinMenuPropertiesUtil.l_main_menu_type = l_main_menu_type;
	}

	public static String getL_main_menu_url() {
		return l_main_menu_url;
	}

	public static void setL_main_menu_url(String l_main_menu_url) {
		WeiXinMenuPropertiesUtil.l_main_menu_url = l_main_menu_url;
	}

	public static String getL_main_menu_name_1() {
		return l_main_menu_name_1;
	}

	public static void setL_main_menu_name_1(String l_main_menu_name_1) {
		WeiXinMenuPropertiesUtil.l_main_menu_name_1 = l_main_menu_name_1;
	}

	public static String getL_main_menu_type_1() {
		return l_main_menu_type_1.length()==0?"view":l_main_menu_type_1;
	}

	public static void setL_main_menu_type_1(String l_main_menu_type_1) {
		WeiXinMenuPropertiesUtil.l_main_menu_type_1 = l_main_menu_type_1;
	}

	public static String getL_main_menu_url_1() {
		return l_main_menu_url_1;
	}

	public static void setL_main_menu_url_1(String l_main_menu_url_1) {
		WeiXinMenuPropertiesUtil.l_main_menu_url_1 = l_main_menu_url_1;
	}

	public static String getL_main_menu_name_2() {
		return l_main_menu_name_2;
	}

	public static void setL_main_menu_name_2(String l_main_menu_name_2) {
		WeiXinMenuPropertiesUtil.l_main_menu_name_2 = l_main_menu_name_2;
	}

	public static String getL_main_menu_type_2() {
		return l_main_menu_type_2.length()==0?"view":l_main_menu_type_2;
	}

	public static void setL_main_menu_type_2(String l_main_menu_type_2) {
		WeiXinMenuPropertiesUtil.l_main_menu_type_2 = l_main_menu_type_2;
	}

	public static String getL_main_menu_url_2() {
		return l_main_menu_url_2;
	}

	public static void setL_main_menu_url_2(String l_main_menu_url_2) {
		WeiXinMenuPropertiesUtil.l_main_menu_url_2 = l_main_menu_url_2;
	}

	public static String getL_main_menu_name_3() {
		return l_main_menu_name_3;
	}

	public static void setL_main_menu_name_3(String l_main_menu_name_3) {
		WeiXinMenuPropertiesUtil.l_main_menu_name_3 = l_main_menu_name_3;
	}

	public static String getL_main_menu_type_3() {
		return l_main_menu_type_3.length()==0?"view":l_main_menu_type_3;
	}

	public static void setL_main_menu_type_3(String l_main_menu_type_3) {
		WeiXinMenuPropertiesUtil.l_main_menu_type_3 = l_main_menu_type_3;
	}

	public static String getL_main_menu_url_3() {
		return l_main_menu_url_3;
	}

	public static void setL_main_menu_url_3(String l_main_menu_url_3) {
		WeiXinMenuPropertiesUtil.l_main_menu_url_3 = l_main_menu_url_3;
	}

	public static String getM_main_menu_name() {
		return m_main_menu_name;
	}

	public static void setM_main_menu_name(String m_main_menu_name) {
		WeiXinMenuPropertiesUtil.m_main_menu_name = m_main_menu_name;
	}

	public static String getM_main_menu_type() {
		return m_main_menu_type.length()==0?"view":m_main_menu_type;
	}

	public static void setM_main_menu_type(String m_main_menu_type) {
		WeiXinMenuPropertiesUtil.m_main_menu_type = m_main_menu_type;
	}

	public static String getM_main_menu_url() {
		return m_main_menu_url;
	}

	public static void setM_main_menu_url(String m_main_menu_url) {
		WeiXinMenuPropertiesUtil.m_main_menu_url = m_main_menu_url;
	}

	public static String getM_main_menu_name_1() {
		return m_main_menu_name_1;
	}

	public static void setM_main_menu_name_1(String m_main_menu_name_1) {
		WeiXinMenuPropertiesUtil.m_main_menu_name_1 = m_main_menu_name_1;
	}

	public static String getM_main_menu_type_1() {
		return m_main_menu_type_1.length()==0?"view":m_main_menu_type_1;
	}

	public static void setM_main_menu_type_1(String m_main_menu_type_1) {
		WeiXinMenuPropertiesUtil.m_main_menu_type_1 = m_main_menu_type_1;
	}

	public static String getM_main_menu_url_1() {
		return m_main_menu_url_1;
	}

	public static void setM_main_menu_url_1(String m_main_menu_url_1) {
		WeiXinMenuPropertiesUtil.m_main_menu_url_1 = m_main_menu_url_1;
	}

	public static String getM_main_menu_name_2() {
		return m_main_menu_name_2;
	}

	public static void setM_main_menu_name_2(String m_main_menu_name_2) {
		WeiXinMenuPropertiesUtil.m_main_menu_name_2 = m_main_menu_name_2;
	}

	public static String getM_main_menu_type_2() {
		return m_main_menu_type_2.length()==0?"view":m_main_menu_type_2;
	}

	public static void setM_main_menu_type_2(String m_main_menu_type_2) {
		WeiXinMenuPropertiesUtil.m_main_menu_type_2 = m_main_menu_type_2;
	}

	public static String getM_main_menu_url_2() {
		return m_main_menu_url_2;
	}

	public static void setM_main_menu_url_2(String m_main_menu_url_2) {
		WeiXinMenuPropertiesUtil.m_main_menu_url_2 = m_main_menu_url_2;
	}

	public static String getM_main_menu_name_3() {
		return m_main_menu_name_3;
	}

	public static void setM_main_menu_name_3(String m_main_menu_name_3) {
		WeiXinMenuPropertiesUtil.m_main_menu_name_3 = m_main_menu_name_3;
	}

	public static String getM_main_menu_type_3() {
		return m_main_menu_type_3.length()==0?"view":m_main_menu_type_3;
	}

	public static void setM_main_menu_type_3(String m_main_menu_type_3) {
		WeiXinMenuPropertiesUtil.m_main_menu_type_3 = m_main_menu_type_3;
	}

	public static String getM_main_menu_url_3() {
		return m_main_menu_url_3;
	}

	public static void setM_main_menu_url_3(String m_main_menu_url_3) {
		WeiXinMenuPropertiesUtil.m_main_menu_url_3 = m_main_menu_url_3;
	}

	public static String getR_main_menu_name() {
		return r_main_menu_name;
	}

	public static void setR_main_menu_name(String r_main_menu_name) {
		WeiXinMenuPropertiesUtil.r_main_menu_name = r_main_menu_name;
	}

	public static String getR_main_menu_type() {
		return r_main_menu_type.length()==0?"view":r_main_menu_type;
	}

	public static void setR_main_menu_type(String r_main_menu_type) {
		WeiXinMenuPropertiesUtil.r_main_menu_type = r_main_menu_type;
	}

	public static String getR_main_menu_url() {
		return r_main_menu_url;
	}

	public static void setR_main_menu_url(String r_main_menu_url) {
		WeiXinMenuPropertiesUtil.r_main_menu_url = r_main_menu_url;
	}

	public static String getR_main_menu_name_1() {
		return r_main_menu_name_1;
	}

	public static void setR_main_menu_name_1(String r_main_menu_name_1) {
		WeiXinMenuPropertiesUtil.r_main_menu_name_1 = r_main_menu_name_1;
	}

	public static String getR_main_menu_type_1() {
		return r_main_menu_type_1.length()==0?"view":r_main_menu_type_1;
	}

	public static void setR_main_menu_type_1(String r_main_menu_type_1) {
		WeiXinMenuPropertiesUtil.r_main_menu_type_1 = r_main_menu_type_1;
	}

	public static String getR_main_menu_url_1() {
		return r_main_menu_url_1;
	}

	public static void setR_main_menu_url_1(String r_main_menu_url_1) {
		WeiXinMenuPropertiesUtil.r_main_menu_url_1 = r_main_menu_url_1;
	}

	public static String getR_main_menu_name_2() {
		return r_main_menu_name_2;
	}

	public static void setR_main_menu_name_2(String r_main_menu_name_2) {
		WeiXinMenuPropertiesUtil.r_main_menu_name_2 = r_main_menu_name_2;
	}

	public static String getR_main_menu_type_2() {
		return r_main_menu_type_2.length()==0?"view":r_main_menu_type_2;
	}

	public static void setR_main_menu_type_2(String r_main_menu_type_2) {
		WeiXinMenuPropertiesUtil.r_main_menu_type_2 = r_main_menu_type_2;
	}

	public static String getR_main_menu_url_2() {
		return r_main_menu_url_2;
	}

	public static void setR_main_menu_url_2(String r_main_menu_url_2) {
		WeiXinMenuPropertiesUtil.r_main_menu_url_2 = r_main_menu_url_2;
	}

	public static String getR_main_menu_name_3() {
		return r_main_menu_name_3;
	}

	public static void setR_main_menu_name_3(String r_main_menu_name_3) {
		WeiXinMenuPropertiesUtil.r_main_menu_name_3 = r_main_menu_name_3;
	}

	public static String getR_main_menu_type_3() {
		return r_main_menu_type_3.length()==0?"view":r_main_menu_type_3;
	}

	public static void setR_main_menu_type_3(String r_main_menu_type_3) {
		WeiXinMenuPropertiesUtil.r_main_menu_type_3 = r_main_menu_type_3;
	}

	public static String getR_main_menu_url_3() {
		return r_main_menu_url_3;
	}

	public static void setR_main_menu_url_3(String r_main_menu_url_3) {
		WeiXinMenuPropertiesUtil.r_main_menu_url_3 = r_main_menu_url_3;
	}

	public static String getMenuPath() {
		return menuPath;
	}

	public static void setMenuPath(String menuPath) {
		WeiXinMenuPropertiesUtil.menuPath = menuPath;
	}

	public static void setProperties(String key, String value) {
		properties.setProperty(key, value);
	}
}
